$(function() {

				var $container = $('#container'), filters = {};

				$container.isotope({
					itemSelector : '.galeryimg',
					masonry : {
						columnWidth : 60
					}
				});

				// filter buttons
				$('.filter a').click(function() {
					var $this = $(this);
					// don't proceed if already selected
					if ($this.hasClass('selected')) {
						return;
					}

					var $optionSet = $this.parents('.option-set');
					// change selected class
					$optionSet.find('.selected').removeClass('selected');
					$this.addClass('selected');

					// store filter value in object
					// i.e. filters.color = 'red'
					var group = $optionSet.attr('data-filter-group');
					filters[group] = $this.attr('data-filter-value');
					// convert object into array
					var isoFilters = [];
					for ( var prop in filters) {
						isoFilters.push(filters[prop])
					}
					var selector = isoFilters.join('');
					$container.isotope({
						filter : selector
					});

					return false;
				});

			}); 